<template>
    <div>
        <el-upload class="upload-demo" drag action :http-request="handleUpload">
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
            <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>
        </el-upload>
        <h1>{{ this.queryParams.licensePlate }}</h1>

    </div>
</template>

<script>
import { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/parking/order";
import { uploadIdNumberImg } from '@/api/parking/identification.js'
export default {
    data() {
        return { 
            orderList: [],
            imgSrc: "",
            queryParams: {
                licensePlate: null,
            },
        }
    },
    methods: {
        handleUpload(file) {
            //console.log(file,123);
            const formData = new FormData();
            formData.append('imgFile', file.file);
            uploadIdNumberImg(formData).then(res => {
                console.log(res);
                this.queryParams.licensePlate = res.data.licensePlate;
                //this.imgSrc=URL.file.file
                this.$modal.msgSuccess("识别成功")
                listOrder(this.queryParams).then(response=>{
                    this.orderList=response.rows;
                    console.log(this.orderList);
                })   
            })
        }
    }
}
</script>

<style></style>